<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="commons/taglibs.jsp" %>
<!DOCTYPE html>
<!-- saved from url=(0026)http://sell.fqapps.com/reg -->
<html class="js cssanimations"><head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no">
    <title>登录-一折微信淘客系统</title>

    <link rel="stylesheet" type="text/css" href="${ctx}/assets/css/amazeui.css">
    <link rel="stylesheet" type="text/css" href="${ctx}/assets/css/admin.css">
    <link rel="stylesheet" type="text/css" href="${ctx}/assets/css/style.css">
	<link rel="stylesheet" type="text/css" href="${ctx}/assets/css/login.css"/>

    <!--[if (gte IE 9)|!(IE)]><!-->
    <script type="text/javascript" src="${ctx}/assets/js/jquery.min.js"></script>
    <script type="text/javascript" src="${ctx}/assets/js/fastclick.min.js"></script>
    <script>$(function() {FastClick.attach(document.body);});</script>
    <!--<![endif]-->

    <script type="text/javascript" src="${ctx}/assets/js/amazeui.min.js"></script>
</head>


<body>
<%@ include file="commons/dialog.jsp" %>
<script>

$(function() {
	
	$('#authcodeimg').attr("src", "${ctx}/authimage/verifycode.do?id=?"+Math.random());

    $('#authcodeimg').on('click', function() {
        $(this).attr("src", "${ctx}/authimage/verifycode.do?id=?"+Math.random());
    });
	
	$('#verifyCode').keypress(function(event){  
		var keycode = (event.keyCode ? event.keyCode : event.which);  
		if(keycode == '13'){  
			$('#submit').click();
		}  
	});  

	$('#submit').on('click', function() {
		var mobile = $('#mobile').val();
		var password = $('#password').val();
		var verifyCode = $('#verifyCode').val();
		
		if(mobile == ""){
			$("#fq_alert_info").html("手机号不能为空！");
			$('#fq_alert').modal({});
			return
		}
		
		if(password == ""){
			$("#fq_alert_info").html("密码不能为空！");
			$('#fq_alert').modal({});
			return
		}
		
		if(verifyCode == ""){
			$("#fq_alert_info").html("验证码不能为空！");
			$('#fq_alert').modal({});
			return
		}
		
		$.post("${ctx}/user/login.do",{mobile:mobile,password:password,verifyCode:verifyCode},function(result){
				if(result.code == 200){
					window.location.href="${ctx}/user/indexPage.do"; 
				}else{					
					$("#fq_alert_info").html(result.message);
					$('#fq_alert').modal({
						closeViaDimmer:false
					});
					if(result.code == 0){						
						$('#verifyCode').val("");
						$('#authcodeimg').attr("src", "${ctx}/authimage/verifycode.do?id=?"+Math.random());					
					}else{
						$('#password').val("");
					}
				}
		});
	});
	
});


</script>

<header class="sso_header">
	<a href="" class="logo"></a>
</header>

<section class="content_box">

<div class="am-form am-form-horizontal" method="post" data-am-validator="" novalidate="novalidate">
  <div class="am-form-group">
    <div class="am-u-sm-12">
      <input type="number" placeholder="输入您的手机" id="mobile" required pattern="^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$">
    </div>
  </div>

  <div class="am-form-group">
    <div class="am-u-sm-12">
      <input type="password" placeholder="输入您的密码" id="password" required>
    </div>
  </div>
  
  <div class="am-form-group">
    <div class="am-u-sm-8">
      <input type="text" placeholder="输入验证码" id="verifyCode" required>
    </div>
	<div class="am-u-sm-4 am-padding-left-0">
      <img class="authcodeimg" id="authcodeimg" src="" style="cursor: pointer;">
    </div>
  </div>

  <div class="am-form-group">
	<div class="am-u-sm-12 ">
      <button id="submit" class="am-btn am-btn-primary am-btn-block">登录</button>
    </div>
  </div>
  
  <h5 class="reg_now"><a href="${ctx}/user/registerPage.do">立即注册</a> / <a href="${ctx}/user/resetPasswordPage.do">忘记密码</a></h5>
  
</div>

</section>

<footer>
	<div class="slogan">— 微信淘客盈利助手 —</div>
	<div style="color: #d1d1d1;" class="am-text-sm am-margin-top-xs am-text-center"> 深圳前海刷云科技有限公司  CopyRight©2016  闽ICP备16026055号</div>
</footer>

</body></html>